import { User } from 'src/modules/system/user/entities/user.entity';
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, ManyToOne, OneToMany, ManyToMany, JoinTable, JoinColumn } from 'typeorm';
import { Exebook } from 'src/modules/questionbank/exebook/entities/exebook.entity';

@Entity('user_error')
export class UserError {
    @PrimaryGeneratedColumn('uuid')
    Id: string;

    @ManyToOne(() => User, user => user.errorLinks)
    user: User;
    @ManyToOne(() => Exebook, ExeBook => ExeBook.userLinks)
    exe: Exebook;

    @Column({ default: 1 })
    errorCount: number;

    @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
    lastErrorTime: Date;
}
